{include file='imobile_header.tpl'}

<div id="topbar">
  <div id="leftnav">
    <a href="user_home.php"><img alt="home" src="./include/imobile/iwebkit/images/home.png" /></a>
  </div> 
  <div id="title"> 
    {lang_print id=11340058}
  </div>
  <div id="bluerightbutton"><a href="javascript:iMobile_toggleFilter('#content','#contentlist');">{lang_print id=11340057}</a></div>
</div>

<div id="content" style="display: none">
	
	<span class="graytitle">{lang_print id=11340059}</span>
	<form action="browse_events.php" action="POST">
	<ul class="pageitem"> 
		<li class="select">
			 <select name='v'>
		        <option value='1'{if $v == "1"} SELECTED{/if}>{lang_print id=3000206}</option>
		        {if $user->user_exists}<option value='2'{if $v == "2"} SELECTED{/if}>{lang_print id=3000207}</option>{/if}
		        <option value='3'{if $v == "3" || empty($v)} SELECTED{/if}>{lang_print id=3000210}</option>
			 </select>
		</li>
		<li class="select">
			 <select name='s'>
		        <option value='event_totalmembers DESC'{if $s == "event_totalmembers DESC"} SELECTED{/if}>{lang_print id=3000209}</option>
		        <option value='event_date_start ASC'{if $s == "event_date_start ASC" || empty($s)} SELECTED{/if}>{lang_print id=3000211} (AZ)</option>
		        <option value='event_date_start DESC'{if $s == "event_date_start DESC"} SELECTED{/if}>{lang_print id=3000211} (ZA)</option>
		        <option value='event_date_end ASC'{if $s == "event_date_end ASC"} SELECTED{/if}>{lang_print id=3000212} (AZ)</option>
		        <option value='event_date_end DESC'{if $s == "event_date_end DESC"} SELECTED{/if}>{lang_print id=3000212} (ZA)</option>
			 </select>
		</li>
		<li class="select">
			 <select name='eventcat_id'>
			 	<option value="">{lang_print id=3000213}</option>
    		 {section name=cat_loop loop=$cats}
    			<option value="{$cats[cat_loop].cat_id}" {if $eventcat_id == $cats[cat_loop].cat_id}selected='selected'{/if} >{lang_print id=$cats[cat_loop].cat_title}</option>
	          {section name=subcat_loop loop=$cats[cat_loop].subcats}
	          	<option value="{$cats[cat_loop].subcats[subcat_loop].subcat_id}" {if $eventcat_id == $cats[cat_loop].subcats[subcat_loop].subcat_id}selected='selected'{/if}> - {lang_print id=$cats[cat_loop].subcats[subcat_loop].subcat_title}</option>
	          {/section}
   			 {/section}
			 </select>
		</li>
	</ul>
	
    <div class="iButtons">
      <input name="submit" type="submit" value="{lang_print id=11340060}" class="iPush" /></li>
    </div>	
	
	</form>
</div>

<div id="contentlist">


  {if $events|@count == 0}
  	
	  <div class="boxinfo"> 
	  	{lang_print id=3000214}
	  </div>  
  {else}
  
	<div id="tributton"> 
		<div class="links"> 
			{if $p != 1}<a href='browse_events.php?s={$s}&v={$v}&eventcat_id={$eventcat_id}&p={math equation="p-1" p=$p}'>{lang_print id=182}</a>{else}<a href='browse_events.php?s={$s}&v={$v}&eventcat_id={$eventcat_id}&p=1'>{lang_print id=182}</a>{/if}<a href="browse_events.php">Home</a>{if $p != $maxpage}<a href='browse_events.php?s={$s}&v={$v}&eventcat_id={$eventcat_id}&p={math equation="p+1" p=$p}'>{lang_print id=183}</a>{else}<a href='browse_events.php?s={$s}&v={$v}&eventcat_id={$eventcat_id}&p={$maxpage}'>{lang_print id=183}</a>{/if}
	    </div> 
	</div>   
  	<div class="page_stats">
	    {if $p_start == $p_end}
	      {lang_sprintf id=184 1=$p_start 2=$total_events}
	    {else}
	      {lang_sprintf id=185 1=$p_start 2=$p_end 3=$total_events}
	    {/if}
  	</div>
	  <ul class="records">	
	  {section name=event_loop loop=$events}
	  		<li class="record">
		  		<a href="{$url->url_create("event", $smarty.const.NULL, $events[event_loop].event->event_info.event_id)}">
		  			<img class='photo' src='{$events[event_loop].event->event_photo("./images/nophoto.gif", TRUE)}' border='0' />
			        <span class="name">{$events[event_loop].event->event_info.event_title}</span>
			        <span class="arrow"></span>
		  		</a>
	  		</li>
	  {/section}
	  </ul>

  {/if}


</div>


{include file='imobile_footer.tpl'}

